Find the repeated items of a TupleΒΆ
Find the repeated items of a Tuple.
# create a tuple
T = 2, 4, 5, 6, 2, 3, 4, 4, 7
print(T) # (2, 4, 5, 6, 2, 3, 4, 4, 7)
# return the number of times the item appears in the tuple
count = T.count(4)
print(count) # 3